<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="format-detection" content="telephone = no">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <style type="text/css">
         .item {
         padding: 20px;
         max-width: 600px;
         margin: 0 auto;
         text-align: center;
         background-color: #999999;
         margin-top: 20px;
         }
      </style>
    <script>
        function callAppToast(){
            console.log("callAppToast.");
            myjs.takeNativeAction("showToast", {message: "this is a message from html."});
        }
        function openActivityA(){
            console.log("openActivityA.");
            myjs.takeNativeAction("openActivity", {message: "SecondActivity"});
        }
        function login(){
            console.log("login.");
            myjs.takeNativeActionWithCallback("login", {}, function(res) {
                 var element = document.createElement("div");
                 element.appendChild(document.createTextNode("result: "+res.accountName));
                 document.getElementById('login_id').appendChild(element);
            });
        }
    </script>
    <script src="js/myjs.js" charset="utf-8"></script>
</head>
<body style="height: 100%;">
<div class="item" style="font-size: 20px; color: #ffffff" onclick="callAppToast()">调用: showToast</div>
<div class="item" style="font-size: 20px; color: #ffffff" onclick="openActivityA()">打开主进程的页面</div>
<div id="login_id" class="item" style="font-size: 20px; color: #ffffff" onclick="login()">调用且返回结果</div>

</body>
</html>